Skip to content

Conversation

@harshit078
Copy link
Contributor

@harshit078 harshit078 commented Jan 29, 2026

Before submitting a pull request, please take a look at our
Contributing guidelines and verify:

  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).
  • Link an issue if there is one related to your pull request. If no issue is linked, one will be auto-generated and linked.

Closes #18913

What changed

  • implemented attribute-based routing for metrics
  • added MetricRoutingInfo with dsn and release as its field
  • added routing to MetricOptions and enabled captureMetric to inject routing info into attributes
  • similarly added routing to InternalCaptureMetricOptions
  • created _stripRoutingAttributes function which removes routing info before sending to sentry

@harshit078 harshit078 marked this pull request as ready for review February 2, 2026 12:05
@harshit078
Copy link
Contributor Author

Hi @chargome, the PR is ready to review. Thanks !

@Lms24 Lms24 requested a review from chargome February 4, 2026 09:05
Copy link
Member

@chargome chargome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks for opening the PR! I left some comments. Also, we definitely want to test this behaviour somehow in a browser integration test.

const container = Array.isArray(item) ? (item[1] as SerializedMetricContainer) : undefined;
const containerItems = container?.items;
if (containerItems) {
metric = containerItems[0];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this mean we always just pull the first metric?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it would mean we pull the first metric. What I'm thinking now after your comment is that I can add a logic which will check if all metrics and route to same or multiple destinations. Whats your opinion ?

@harshit078 harshit078 requested a review from chargome February 6, 2026 12:50
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

getSpanStatusFromHttpCode,
setHttpStatus,
makeMultiplexedTransport,
MULTIPLEXED_TRANSPORT_EXTRA_KEY,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed public export breaks browser SDK users

High Severity

MULTIPLEXED_TRANSPORT_EXTRA_KEY was removed from the @sentry/browser re-exports. This constant is part of the public API — the CHANGELOG even shows users importing it from @sentry/browser. Removing it is a breaking change that will cause import errors for existing consumers, violating the rule against removing publicly exported symbols without deprecation.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support routing metrics to different DSNs in MFE setup

2 participants